#ifndef FILEPROGRESS_H
#define FILEPROGRESS_H

#include <QObject>
#include"agreement.h"
#include<mutex>
#include<map>

class FileProgress : public QObject
{
    Q_OBJECT
public:
    explicit FileProgress(QObject *parent = nullptr);

signals:
    void FunishDownFile(std::string,int);

public:
    std::mutex& fileMutex(std::string &fileIdenter);

private:
    void downFile(std::vector<uint8_t>);

private:
    //用于文件写的操作锁
    std::mutex fileWriteMutex;
    std::map<std::string,std::mutex> fileWriteMutexMap;

    std::string defDownPath = "D:\\zhang\\ThreadSever\\networkdisk\\downLoad\\";

};

#endif // FILEPROGRESS_H
